package com.cloud.producer.controller;


import com.cloud.producer.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerController {

    @Autowired
    SendService sendService;

    //发送消息到消息代理
    @GetMapping("/send")
    public Message sendRequest(){
        Message msg = MessageBuilder.withPayload(" msg From Producer!! ").build();
        sendService.sendOrder().send(msg);
        return msg;
    }


}
